Device and method for coding video data based on one or more reference lines

ABSTRACT

A method of decoding a bistream by an electronic device is provided. A block unit is determined from an image frame according to the bitstream. A line index determined in the bitstream is compared with a first predefined value to determine whether a mode flag is included in the bitstream. A mode index is determined for directly selecting a prediction mode of the block unit from a most probable mode (MPM) list of the block unit when the mode flag is not included in the bitstream. The mode flag is compared to a second predefined value when the mode flag is included in the bitstream to determine whether the prediction mode is selected from the MPM list. One of a plurality of reference lines is selected based on the line index. The block unit is reconstructed based on the selected reference line and the prediction mode.

CROSS-REFERENCE TO RELATED APPLICATION(S)

This application is a continuation application of U.S. patentapplication Ser. No. 16/453,580, filed on Jun. 26, 2019 (“the '580application”), currently pending, which claims the benefit of andpriority to a provisional U.S. Patent Application Ser. No. 62/692,175,filed on Jun. 29, 2018 (“the '175 provisional”). The contents of the'580 application and the '175 provisional are fully incorporated hereinby reference in their entireties.

FIELD

The present disclosure generally relates to video coding, and moreparticularly, to techniques for a selection of a prediction mode and areference line.

BACKGROUND

Intra prediction is a coding tool for video coding. In a conventionalvideo coding method, an encoder and a decoder only use previouslyreconstructed pixels in a closest pixel line adjacent to a coding blockto generate reference pixels and predictors for predicting orreconstructing the coding block along an orientation.

However, the closest pixel line may include a texture of an objectdifferent from other objects in the coding block, and/or signal noise.Thus, the encoder can exploit the closest pixel line and other adjacentpixel lines near the closest pixel line to generate the reference pixelsand the predictors. When the encoder exploits more than one pixel lineto generate the reference pixels and the predictors, the encoder needsto signal a flag indicating the selected reference lines into abitstream. As a result, it is necessary for the decoder to parse theflag from the bitstream and determine, based on the flag, which of thepixel lines are selected for the coding block.

In addition, the number of predicted results may be too high for theencoder to quickly select an appropriate predicted result, when theencoder selects different reference lines to predict the coding blockbased on a plurality of intra modes included in a predefined mode list.Thus, the encoder may need different mode lists for different referencelines.

SUMMARY

The present disclosure is directed to a device and method for codingvideo data based on one or more reference lines.

In a first aspect of the present disclosure, a method for decoding abitstream by an electronic device and the electronic device for decodingthe bitstream by the method are provided. The method comprisesdetermining a block unit from an image frame according to the bitstream;determining a line index of the block unit in the bitstream; comparingthe line index with a first predefined value to determine whether a modeflag is included in the bitstream; determining a mode index in thebitstream for directly selecting a prediction mode of the block unitfrom a most probable mode (MPM) list of the block unit when the modeflag is not included in the bitstream; comparing the mode flag to asecond predefined value when the mode flag is included in the bitstreamto determine whether the prediction mode is selected from the MPM listbased on the mode index; selecting one of a plurality of reference linesbased on the line index; and reconstructing the block unit based on theselected one of the plurality of reference lines and the predictionmode.

In a second aspect of the present disclosure, a method for decoding abitstream by an electronic device and the electronic device for decodingthe bitstream by the method are provided. The method comprisesdetermining a block unit from an image frame according to the bitstream;determining a line index in the bitstream for selecting a predictionline of the block unit from a plurality of reference lines; determining,based on the line index. whether a mode flag is included in thebitstream; directly determining a most probable mode (MPM) index fromthe bitstream for selecting a prediction mode of the block unit from aMPM list of the block unit when the mode flag is not included in thebitstream; comparing the mode flag with a predefined value for selectingone of the MPM index and a non-MPM index to determine the predictionmode when the mode flag is included in the bitstream; and reconstructingthe block unit based on the prediction line and the prediction mode.

BRIEF DESCRIPTION OF THE DRAWINGS

Aspects of the exemplary disclosure are best understood from thefollowing detailed description when read with the accompanying figures.Various features are not drawn to scale, dimensions of various featuresmay be arbitrarily increased or reduced for clarity of discussion.

FIG. 1 is a block diagram of an example implementation of a systemconfigured to encode and decode video data according to one or moretechniques of the present disclosure.

FIG. 2 is a block diagram of an example implementation of a decodermodule of the destination device in the system of FIG. 1.

FIG. 3 illustrates a flowchart in accordance with an exampleimplementation of a selection method for selecting a reference line anda prediction mode.

FIG. 4 is a schematic illustration of an example implementation of ablock unit and a plurality of reference lines neighboring to a blockunit.

FIG. 5 illustrates a flowchart in accordance with an exampleimplementation of a selection method for selecting a reference line anda prediction mode.

FIG. 6 illustrates a flowchart in accordance with an exampleimplementation of a prediction method according to a line index and amode flag.

FIG. 7 illustrates a flowchart in accordance with an exampleimplementation of a line quantity determination method.

FIG. 8 is a block diagram of an example implementation of an encodermodule of a source device in the system of FIG. 1.

FIG. 9 illustrates a flowchart in accordance with an exampleimplementation of a selection method for selecting a reference line anda prediction mode.

DETAILED DESCRIPTION

The following description contains specific information pertaining toexample implementations in the present disclosure. The drawings in thepresent disclosure and their accompanying detailed description aredirected to merely example implementations. However, the presentdisclosure is not limited to merely these example implementations. Othervariations and implementations of the present disclosure will occur tothose skilled in the art. Unless noted otherwise, like or correspondingelements among the figures may be indicated by like or correspondingreference numerals. Moreover, the drawings and illustrations in thepresent disclosure are generally not to scale, and are not intended tocorrespond to actual relative dimensions.

For the purpose of consistency and ease of understanding, like featuresare identified (although, in some examples, not shown) by numerals inthe exemplary figures. However, the features in differentimplementations may be differed in other respects, and thus shall not benarrowly confined to what is shown in the figures.

The description uses the phrases “in one implementation,” or “in someimplementations,” which may each refer to one or more of the same ordifferent implementations. The term “coupled” is defined as connected,whether directly or indirectly through intervening components, and isnot necessarily limited to physical connections. The term “comprising,”when utilized, means “including, but not necessarily limited to”; itspecifically indicates open-ended inclusion or membership in theso-described combination, group, series and the equivalent.

Additionally, for the purposes of explanation and non-limitation,specific details, such as functional entities, techniques, protocols,standard, and the like are set forth for providing an understanding ofthe described technology. In other examples, detailed description ofwell-known methods, technologies, system, architectures, and the likeare omitted so as not to obscure the description with unnecessarydetails.

Persons skilled in the art will immediately recognize that any codingfunction(s) or algorithm(s) described in the present disclosure may beimplemented by hardware, software or a combination of software andhardware. Described functions may correspond to modules may be software,hardware, firmware, or any combination thereof. The softwareimplementation may comprise computer executable instructions stored oncomputer readable medium such as memory or other type of storagedevices. For example, one or more microprocessors or general purposecomputers with communication processing capability may be programmedwith corresponding executable instructions and carry out the describednetwork function(s) or algorithm(s). The microprocessors or generalpurpose computers may be formed of applications specific integratedcircuitry (ASIC), programmable logic arrays, and/or using one or moredigital signal processor (DSPs). Although some of the exampleimplementations described in this specification are oriented to softwareinstalled and executing on computer hardware, nevertheless, alternativeexample implementations implemented as firmware or as hardware orcombination of hardware and software are well within the scope of thepresent disclosure.

The computer readable medium includes but is not limited to randomaccess memory (RAM), read only memory (ROM), erasable programmableread-only memory (EPROM), electrically erasable programmable read-onlymemory (EEPROM), flash memory, compact disc read-only memory (CD ROM),magnetic cassettes, magnetic tape, magnetic disk storage, or any otherequivalent medium capable of storing computer-readable instructions.

FIG. 1 is a block diagram of an example implementation of a system thatmay be configured to encode and decode video data according to one ormore techniques of the present disclosure. In the implementation, thesystem includes a source device 11, a destination device 12, and acommunication medium 13. In at least one implementation, the sourcedevice 11 may include any device configured to encode video data andtransmit encoded video data to the communication medium 13. In at leastone implementation, the destination device 12 may include any deviceconfigured to receive encoded video data via the communication medium 13and to decode encoded video data.

In at least one implementation, the source device 11 may wiredly and/orwirelessly communicate with the destination device 12 via thecommunication medium 13. The source device 11 may include a sourcemodule 111, an encoder module 112, and a first interface 113. Thedestination device 12 may include a display module 121, a decoder module122, and a second interface 123. In at least one implementation, thesource device 11 may be a video encoder, and the destination device 12may be a video decoder.

In at least one implementation, the source device 11 and/or thedestination device 12 may be a mobile phone, a tablet, a desktop, anotebook, or other electronic device. FIG. 1 merely illustrates oneexample of the source device 11 and the destination device 12, and thesource device 11 and the destination device 12 in other implementationsmay include more or less components than illustrated, or have adifferent configuration of the various components.

In at least one implementation, the source module 111 of the sourcedevice 11 may include a video capture device to capture a new video, avideo archive storing previously captured video, and/or a video feedinterface to receive video from a video content provider. In at leastone implementation, the source module 111 of the source device 11 maygenerate computer graphics-based data as the source video, or acombination of live video, archived video, and computer-generated video.In at least one implementation, the video capturing device may be acharge-coupled device (CCD) image sensor, a complementarymetal-oxide-semiconductor (CMOS) image sensor, or a camera.

In at least one implementation, the encoder module 112 and the decodermodule 122 may each be implemented as any of a variety of suitableencoder/decoder circuitry, such as one or more microprocessors, acentral processing unit (CPU), a graphic processing unit (GPU), a systemon chip (SoC), digital signal processors (DSPs), application specificintegrated circuits (ASICs), field programmable gate arrays (FPGAs),discrete logic, software, hardware, firmware or any combinationsthereof. When the techniques are implemented partially in software, adevice may store instructions for the software in a suitable,non-transitory computer-readable medium and execute the instructions inhardware using one or more processors to perform the techniques of thepresent disclosure. In at least one implementation, each of the encodermodule 112 and the decoder module 122 may be included in one or moreencoders or decoders, any of which may be integrated as part of acombined encoder/decoder (CODEC) in a respective device.

In at least one implementation, the first interface 113 and the secondinterface 123 may adopt customized protocols or follow existingstandards or de facto standards including, but not limited to, Ethernet,IEEE 802.11 or IEEE 802.15 series, Wireless USB or telecommunicationstandards including, but not limited to, GSM, CDMA2000, TD-SCDMA, WiMAX,3GPP-LTE or TD-LTE. In at least one implementation, the first interface113 and the second interface 123 may each include any device configuredto transmit and/or store a compliant video bitstream to thecommunication medium 13 and to receive the compliant video bitstreamfrom the communication medium 13. In at least one implementation, thefirst interface 113 and the second interface 123 may include a computersystem interface that may enable a compliant video bitstream to bestored on a storage device or to be received from the storage device.For example, the first interface 113 and the second interface 123 mayinclude a chip set supporting Peripheral Component Interconnect (PCI)and Peripheral Component Interconnect Express (PCIe) bus protocols,proprietary bus protocols, Universal Serial Bus (USB) protocols, I2C, orany other logical and physical structure that may be used tointerconnect peer devices.

In at least one implementation, the display module 121 may include adisplay using liquid crystal display (LCD) technology, a plasma displaytechnology, an organic light emitting diode (OLED) display technology,or light emitting polymer display (LPD) technology, although otherdisplay technologies may be used in other implementations. In at leastone implementation, the display module 121 may include a high definitiondisplay or an ultra high definition display.

FIG. 2 is a block diagram of a decoder module 222 representing anexample implementation of the decoder module 122 of the destinationdevice 12 in the system of FIG. 1. In at least one implementation, thedecoder module 222 includes an entropy decoder (e.g., an entropydecoding unit 2221), a prediction processor (e.g., a prediction processunit 2222), an inverse quantization/inverse transform processor (e.g.,an inverse quantization/inverse transform unit 2223), a summer (e.g., afirst summer 2224), a filter (e.g., a filtering unit 2225), and adecoded picture buffer (e.g., a decoded picture buffer 2226). In atleast one implementation, the prediction process unit 2222 of thedecoder module 222 further includes an intra prediction processor (e.g.,an intra prediction unit 22221) and an inter prediction processor (e.g.,an inter prediction unit 22222). In at least one implementation, thedecoder module 222 receives a bitstream, and decodes the bitstream tooutput a decoded video.

In at least one implementation, the entropy decoding unit 2221 mayreceive the bitstream including a plurality of syntax elements from thesecond interface 123 in FIG. 1, and perform a parsing operation on thebitstream to extract syntax elements from the bitstream. As part ofperforming the parsing operation, the entropy decoding unit 2221 mayentropy decode the bitstream to generate quantized transformcoefficients, quantization parameters, transform data, motion vectors,intra modes, partition information, and other syntax information. In atleast one implementation, the entropy decoding unit 2221 may performcontext adaptive variable length coding (CAVLC), context adaptive binaryarithmetic coding (CABAC), syntax-based context-adaptive binaryarithmetic coding (SBAC), probability interval partitioning entropy(PIPE) coding or another entropy coding technique to generate thequantized transform coefficients. In at least one implementation, theentropy decoding unit 2221 provides the quantized transformcoefficients, the quantization parameters, and the transform data to theinverse quantization/inverse transform unit 2223, and provides themotion vectors, the intra modes, the partition information, and othersyntax information to the prediction process unit 2222.

In at least one implementation, the prediction process unit 2222 mayreceive syntax elements, such as motion vectors, intra modes, partitioninformation, and other syntax information, from the entropy decodingunit 2221. In at least one implementation, the prediction process unit2222 may receive the syntax elements including the partitioninformation, and then divide image frames according to the partitioninformation. In at least one implementation, each of the image framesmay be divided into at least one image block according to the partitioninformation. The at least one image block may include a luminance blockfor reconstructing a plurality of luminance samples, and at least onechrominance block for reconstructing a plurality of chrominance samples.The luminance block and the at least one chrominance block may befurther divided to generate macroblocks, coding tree units (CTUs),coding blocks (CBs), sub-divisions thereof, and/or another equivalentcoding unit.

In at least one implementation, during the decoding process, theprediction process unit 2222 receives predicted data including the intramode or the motion vector for a current image block of a specific one ofthe image frames. The current image block may be one of the luminanceblock and the at least one of the chrominance block in the specificimage frame.

In at least one implementation, the intra prediction unit 22221 mayperform intra-predictive coding of a current block unit relative to oneor more neighboring blocks in the same frame as the current block unitbased on the syntax elements related to the intra mode to generate apredicted block. In at least one implementation, the intra mode mayspecify the location of reference samples selected from the neighboringblocks within the current frame.

In at least one implementation, the intra prediction unit 22221 mayreconstruct a plurality of chroma components of the current block unitbased on the plurality of luma components of the current block unit,when the chroma components of the current block are reconstructed by theprediction process unit 2222.

In at least one implementation, the inter prediction unit 22222 mayperform inter-predictive coding of the current block unit relative toone or more blocks in one or more reference image block based on thesyntax elements related to the motion vector to generate the predictedblock. In at least one implementation, the motion vector may indicate adisplacement of the current block unit within the current image blockrelative to a reference block unit within the reference image block. Thereference block unit is a block that is determined to closely match thecurrent block unit. In at least one implementation, the inter predictionunit 22222 receives the reference image block stored in the decodedpicture buffer 2226 and reconstructs the current block unit based on thereceived reference image blocks.

In at least one implementation, the inverse quantization/inversetransform unit 2223 may apply inverse quantization and inversetransformation to reconstruct the residual block in the pixel domain. Inat least one implementation, the inverse quantization/inverse transformunit 2223 may apply inverse quantization to the residual quantizedtransform coefficient to generate a residual transform coefficient, andthen apply inverse transformation to the residual transform coefficientto generate the residual block in the pixel domain. In at least oneimplementation, the inverse transformation may be inversely applied thetransformation process, such as discrete cosine transform (DCT),discrete sine transform (DST), adaptive multiple transform (AMT),mode-dependent non-separable secondary transform (MDNSST),hypercube-givens transform (HyGT), signal dependent transform,Karhunen-Loéeve transform (KLT), wavelet transform, integer transform,sub-band transform or a conceptually similar transform. In at least oneimplementation, the inverse transformation may convert the residualinformation from a transform domain, such as a frequency domain, back tothe pixel domain. In at least one implementation, the degree of inversequantization may be modified by adjusting a quantization parameter.

In at least one implementation, the first summer 2224 adds thereconstructed residual block to the predicted block provided from theprediction process unit 2222 to produce a reconstructed block.

In at least one implementation, the filtering unit 2225 may include adeblocking filter, a sample adaptive offset (SAO) filter, a bilateralfilter, and/or an adaptive loop filter (ALF) to remove blockinessartifacts from the reconstructed block. Additional filters (in loop orpost loop) may also be used in addition to the deblocking filter, theSAO filter, the bilateral filter and the ALF. Such filters are not shownfor brevity, but if desired, may filter the output of the first summer2224. In at least one implementation, the filtering unit 2225 may outputthe decoded video to the display module 121 or other video receivingunit, after the filtering unit 2225 performs the filtering process forthe reconstructed blocks of the specific image frame.

In at least one implementation, the decoded picture buffer 2226 may be areference picture memory that stores the reference block for use indecoding the bitstream by the prediction process unit 2222, e.g., ininter-coding modes. The decoded picture buffer 2226 may be formed by anyof a variety of memory devices, such as dynamic random access memory(DRAM), including synchronous DRAM (SDRAM), magneto-resistive RAM(MRAM), resistive RAM (RRAM), or other types of memory devices. In atleast one implementation, the decoded picture buffer 2226 may be on-chipwith other components of the decoder module 222, or off-chip relative tothose components.

FIG. 3 illustrates a flowchart in accordance with an exampleimplementation of a selection method for selecting a reference line anda prediction mode. The example method is provided by way of exampleonly, as there are a variety of ways to carry out the method. The methoddescribed below may be carried out using the configurations illustratedin FIG. 1 and FIG. 2, for example, and various elements of these figuresare referenced in explaining the example method. Each block shown inFIG. 3 represents one or more processes, methods, or subroutines,carried out in the example method. Furthermore, the order of blocks isillustrative only and may change. Additional blocks may be added or lessblocks may be utilized without departing from the present disclosure.

At block 31, the decoder module 222 determines a block unit from animage frame according to video data, and determines a plurality ofprediction indications for the block unit.

In at least one implementation, the video data may be a bitstream. In atleast one implementation, the destination device 12 may receive thebitstream from an encoder, such as the source device 11, via the secondinterface 123 of the destination device 12. The second interface 123provides the bitstream to the decoder module 222. The decoder module 222determines the image frame based on the bitstream, and divides the imageframe to determine the block unit according to a plurality of partitionindications in the bitstream. For example, the decoder module 222 maydivide the image frames to generate a plurality of coding tree units,and further divide one of the coding tree units to determine the blockunit according to the partition indications based on any video codingstandard.

In at least one implementation, the entropy decoding unit 2221 maydecode the bitstream to determine a plurality of prediction indicationsfor the block unit, and then the decoder module 222 may furtherreconstruct the block unit based on the prediction indications. In atleast one implementation, the prediction indications may include aplurality of flags and a plurality of indices.

At block 32, the intra prediction unit 22221 determines a plurality ofmode candidates, and classifies the mode candidates into a plurality ofcandidate groups for the block unit.

In at least one implementation, the mode candidates may be a pluralityof intra prediction modes including a plurality of angular modes, and aplurality of non-angular modes. In the implementation, the candidategroups include a first candidate group and a second candidate group. Theintra prediction unit 22221 may add at least one of the mode candidatesinto the first candidate group, and add the remaining mode candidatesinto to the second candidate group.

In at least one implementation, the intra prediction unit 22221 maydetermine a most probable list based on a plurality of predicted resultsof neighboring blocks neighboring to the block unit 400. The neighboringblocks may be predicted based on the mode candidates, when theneighboring blocks are predicted by an intra prediction method. Thus,the intra prediction unit 22221 may select the mode candidates of theneighboring blocks as a plurality of most probable modes (MPMs) in themost probable list. In at least one implementation, the most probablelist including the MPMs may be the first candidate group, and theremaining mode candidates may be added into the second candidate group.

At block 33, the intra prediction unit 22221 selects at least one of aplurality of reference lines and one of the mode candidates in one ofthe candidate groups for the block unit based on the predictionindications.

In at least one implementation, the prediction process unit 2222 of thedestination device 12 determines the block unit from the video data viathe entropy decoding unit 2221, and determines the reference linesneighboring with the block unit and having a plurality of line samples.FIG. 4 is a schematic illustration of an example implementation of ablock unit 400 and reference lines having line samples, such as linesamples 4111, 4121, 4131, and 4141 in a first reference line 411, asecond reference line 412, a third reference line 413, and a fourthreference line 414, respectively. In at least one implementation, theblock unit 400 includes a plurality of block components, such a firstblock component 401. In at least one implementation, the intraprediction unit 22221 may generate a predicted component for each of theblock components based on some of the line samples selected according toan orientation 420, and the first summer 2224 may generate a pluralityof reconstructed components based on the predicted components and aplurality of residual components. In the implementation, the firstsummer 2224 may receive the residual components of the block unit 400via the entropy decoding unit 2221 and the inverse quantization/inversetransform unit 2223.

In at least one implementation, the intra prediction unit 22221 mayselect one of the reference lines, and reconstruct the block unit basedon the selected reference line. In at least one implementation, theintra prediction unit 22221 may reconstruct the block unit by one of themode candidates selected from one of the first candidate group and thesecond candidate group, when the selected reference line is a first oneof the reference lines. In the implementation, the first reference lineis the first reference line 411 adjacent to the block unit 400. In atleast one implementation, the intra prediction unit 22221 mayreconstruct the block unit by one of the mode candidates selected fromthe first candidate group, when the selected reference line is differentfrom the first one of the reference lines. In at least oneimplementation, the intra prediction unit 22221 may select more than oneof the reference lines, and reconstruct the block unit based on theselected reference lines by one of the mode candidates selected from thefirst candidate group.

In at least one implementation, the prediction indications may includeat least one of an MPM flag, a line index, an MPM index, and a non-MPMindex. In the implementation, the MPM flag may indicate whether theselected mode candidate of the block unit is included in the firstcandidate group. When the selected mode candidate of the block unit isone of the MPMs in the first candidate group, the intra prediction unit22221 may further determine which one of the mode candidates is theselected mode candidate of the block unit based on the MPM index. Whenthe selected mode candidate of the block unit is one of the non-MPMs inthe second candidate group, the intra prediction unit 22221 may furtherdetermine which one of the mode candidates is the selected modecandidate of the block unit based on the non-MPM index. In addition, theintra prediction unit 22221 may select the at least one of the referencelines based on the line index.

In at least one implementation, the intra prediction unit 22221 mayfirst determine whether the selected mode candidate of the block unit isone of the MPMs based on the MPM flag, and then determine which one ofthe mode candidates is the selected mode candidate based on one of theMPM index and the non-MPM index. In at least one implementation, theintra prediction unit 22221 may determine that the selected modecandidate belongs to the first candidate group, when the selected modecandidates is included in the MPM list. Thus, the intra prediction unit22221 may select at least one of the reference lines for the block unitbased on the line index. In at least one implementation, the intraprediction unit 22221 may determine that the selected mode candidatebelongs to the second candidate group, when the selected mode candidatesis not included in the MPM list. Thus, the intra prediction unit 22221may directly determine the first reference line as the selectedreference line for the block unit. In the implementation, there is noline index for the block unit in the bitstream, when the selected modecandidate belongs to the second candidate group.

In at least one implementation, the intra prediction unit 22221 mayfirst select at least one of the reference lines for the block unitbased on the line index. Then, the intra prediction unit 22221determines which one of the mode candidates is the selected modecandidate based on at least one of the MPM flag, the MPM index, and thenon-MPM index. In at least one implementation, the intra prediction unit22221 determines which one of the mode candidates is the selected modecandidate based on MPM flag and one of the MPM index and the non-MPMindex, when the intra prediction unit 22221 selects the first referenceline as the selected reference line for the block unit based on the lineindex. In at least one implementation, the intra prediction unit 22221may determine that the selected mode candidate is one of the MPMs, whenthe selected reference line is different from the first reference line411. In at least one implementation, the selected reference linesinclude one of the reference lines different from the first referenceline 411, when the number of the selected reference lines is greaterthan one. Thus, the intra prediction unit 22221 may determine that theselected mode candidate is one of the MPMs, when the number of theselected reference lines is greater than one. In the implementation,there is no MPM flag for the block unit in the bitstream, when theselected at least one of the reference lines includes one of thereference lines different from the first reference line 411.

At block 34, the intra prediction unit 22221 reconstructs the block unitbased on the selected at least one of the reference lines according tothe selected mode candidate.

In at least one implementation, the intra prediction unit 22221 mayselect, based on the prediction mode, at least one of the line samplesin the selected at least one of the reference lines for each of theblock components. Then, the intra prediction unit 22221 may generate aplurality of predicted components for the block components. In at leastone implementation, the first summer 2224 of the decoder module 222 inthe destination device 12 may add the predicted components into aplurality of residual components determined from the bitstream toreconstruct the block unit. In addition, the decoder module 222 mayreconstruct all of the other block units in the image frame forreconstructing the image frame and the video.

FIG. 5 illustrates a flowchart in accordance with an exampleimplementation the selection method for selecting a reference line and aprediction mode. The example method is provided by way of example only,as there are a variety of ways to carry out the method. The methoddescribed below may be carried out using the configurations illustratedin FIG. 1 and FIG. 2, for example, and various elements of these figuresare referenced in explaining the example method. Each block shown inFIG. 5 represents one or more processes, methods, or subroutines,carried out in the example method. Furthermore, the order of blocks isillustrative only and may change. Additional blocks may be added or lessblocks may be utilized without departing from the present disclosure.

At block 51, the decoder module 222 determines a block unit from animage frame according to video data, and determines a plurality ofprediction indications for the block unit.

In at least one implementation, the video data may be a bitstream. In atleast one implementation, the destination device 12 may receive thebitstream from an encoder, such as the source device 11, via the secondinterface 123 of the destination device 12. The second interface 123provides the bitstream to the decoder module 222. The decoder module 222determines the image frame based on the bitstream, and divides the imageframe to determine the block unit according to a plurality of partitionindications in the bitstream. For example, the decoder module 222 maydivide the image frames to generate a plurality of coding tree units,and further divide one of the coding tree units to determine the blockunit according to the partition indications based on any video codingstandard.

In at least one implementation, the entropy decoding unit 2221 maydecode the bitstream to determine a plurality of prediction indicationsfor the block unit, and then the decoder module 222 may furtherreconstruct the block unit based on the prediction indications. In atleast one implementation, the prediction indications may include aplurality of flags and a plurality of indices.

At block 52, the intra prediction unit 22221 selects one or more of aplurality of reference lines based on a first index in a plurality ofprediction indications.

In at least one implementation, the first index may be a line index forthe intra prediction unit 22221 to select the one or more referencelines. FIG. 4 is a schematic illustration of an example implementationof a block unit 400 and reference lines having line samples, such asline samples 4111, 4121, 4131, and 4141 in a first reference line 411, asecond reference line 412, a third reference line 413, and a fourthreference line 414, respectively. In at least one implementation, theintra prediction unit 22221 may set a first one of the reference linesas the selected reference line based on the line index. In theimplementation, the first reference line may be the first reference line411 adjacent to the block unit 400. In at least one implementation, theintra prediction unit 22221 may set a specific one of the referencelines different from the first reference line as the selected referenceline. In addition, the intra prediction unit 22221 may select more thanone of the reference lines as the selected reference lines.

At block 53, the intra prediction unit 22221 determines whether theselected one or more reference lines include one of the reference linesdifferent from a predefined one of the reference lines. In at least oneimplementation, the procedure proceeds to block 54, when the selectedone or more reference lines are identical to the predefined referenceline. In at least one implementation, the procedure proceeds to block55, when the selected one or more reference lines include one of thereference lines different from the predefined reference line.

In at least one implementation, the intra prediction unit 22221 may adda plurality of most probable modes (MPMs) into a first candidate group,and add a plurality of non-MPMs into a second candidate group. In atleast one implementation, the MPMs are selected from a plurality of modecandidates including a plurality of angular modes, and a plurality ofnon-angular modes. In at least one implementation, the intra predictionunit 22221 may determine a most probable list based on a plurality ofpredicted results of neighboring blocks adjacent to the block unit 400.The neighboring blocks may be predicted based on the mode candidates,when the neighboring blocks are predicted by an intra prediction method.Thus, the intra prediction unit 22221 may select some of the modecandidates as the MPMs in the most probable list based on the predictedresult of the neighboring blocks.

In at least one implementation, the most probable list including theMPMs may be the first candidate group, and the remaining mode candidatesdifferent from the MPMs may be added into the second candidate group.

In at least one implementation, the MPMs may include a plurality ofangular MPMs and a plurality of non-angular MPMs. In at least oneimplementation, the angular MPMs may be added into the first candidategroup, and the remaining mode candidates different from the MPMs may beadded into the second candidate group.

In at least one implementation, the encoder module 112 of the sourcedevice 11 may select more than one of the reference lines to predict theblock unit according to one of the mode candidates in the firstcandidate group. In at least one implementation, the encoder module 112of the source device 11 may determine the selected reference linedifferent from the predefined reference line to predict the block unitaccording to one of the mode candidates in the first candidate group. Inat least one implementation, the encoder module 112 may select thepredefined reference line to predict the block unit according to one ofthe mode candidates in the second candidate group. In theimplementation, the predefined reference line may be the first referenceline 411 in FIG. 4.

In at least one implementation, the intra prediction unit 22221 maydetermine that the block unit is predicted according to one of the modecandidates in the first candidate group, when the selected one or morereference lines include one of the reference lines different from thepredefined reference line. Thus, the intra prediction unit 22221 maydirectly determine, based on the MPM index, which one of the modecandidates is used for predicting the block unit.

In at least one implementation, the intra prediction unit 22221 maydetermine that the block unit is predicted according to one of the modecandidates selected from one of the first candidate group and the secondcandidate group, when the selected one or more reference lines are thepredefined reference line. Thus, the intra prediction unit 22221 maydetermine, based on at least one of the MPM flag, the MPM index, and thenon-MPM index, which one of the mode candidates is used for predictingthe block unit.

At block 54, the intra prediction unit 22221 determines whether aprediction flag in the prediction indications indicates the secondcandidate group. In at least one implementation, the procedure proceedsto block 55, when one of the candidate groups indicated by theprediction flag is different from the second candidate group. In atleast one implementation, the procedure proceeds to block 56, when theprediction flag indicates the second candidate group.

In at least one implementation, the intra prediction unit 22221 maydetermine that the block unit is predicted according to one of the modecandidates selected from one of the first candidate group and the secondcandidate group, when the selected one or more reference lines are thepredefined reference line. Thus, the intra prediction unit 22221 mayfirst determine whether the block unit is predicted according to one ofthe MPMs or one of the non-MPMs based on the MPM flag. In at least oneimplementation, the second candidate group includes all of the non-MPMs.Thus, the intra prediction unit 22221 may determine that the block unitis predicted by one of non-MPMs, when the prediction flag in theprediction indications indicates the second candidate group. In at leastimplementation, the intra prediction unit 22221 may determine that theblock unit is predicted by one of MPMs, when one of the candidate groupsindicated by the prediction flag is different from the second candidategroup.

At block 55, the intra prediction unit 22221 selects one of the modecandidates based on a second index in the prediction indications.

In at least one implementation, the second index indicates which one ofthe MPMs is used for predicting the block unit. In the implementation,the second index may be the MPM index.

In at least one implementation, the intra prediction unit 22221 maydetermine that the block unit is predicted according to one of the modecandidates in the first candidate group, when the selected one or morereference lines include one of the reference lines different from thepredefined reference line. Thus, the block unit is predicted accordingto one of the MPMs by the encoder module 112. In at least oneimplementation, the intra prediction unit 22221 may directly select oneof the MPMs based on the MPM index.

In at least one implementation, the intra prediction unit 22221 maydetermine that the block unit is predicted according to one of the MPMs,when the selected one or more reference lines are the predefinedreference line and one of the candidate groups indicated by theprediction flag is different from the second candidate group. In theimplementation, the intra prediction unit 22221 may directly select oneof the MPMs based on the MPM index.

At block 56, the intra prediction unit 22221 selects one of the modecandidates based on a third index in the prediction indications.

In at least one implementation, the third index indicates which one ofthe non-MPMs is used for predicting the block unit. In theimplementation, the third index may be the non-MPM index.

In at least one implementation, the intra prediction unit 22221 maydetermine that the block unit is predicted according to one of thenon-MPMs, when the selected one or more reference lines are thepredefined reference line and the prediction flag indicates the secondcandidate group. In at least one implementation, the intra predictionunit 22221 may directly select one of the non-MPMs based on the non-MPMindex.

At block unit 57, the intra prediction unit 22221 reconstructs the blockunit based on the selected one or more reference lines and the selectedmode candidate.

In at least one implementation, the intra prediction unit 22221 mayselect, based on the selected mode candidate, at least one of the linesamples in the selected one or more reference lines for each of theblock components. Then, the intra prediction unit 22221 may generate aplurality of the predicted components for the block components. In atleast one implementation, the first summer 2224 of the decoder module222 in the destination device 12 may add the predicted components into aplurality of residual components determined from the bitstream toreconstruct the block unit. In addition, the decoder module 222 mayreconstruct all of the other block units in the image frame forreconstructing the image frame and the video.

FIG. 6 illustrates a flowchart in accordance with an exampleimplementation of a prediction method according to a line index and amode flag. The example method is provided by way of example only, asthere are a variety of ways to carry out the method. The methoddescribed below may be carried out using the configurations illustratedin FIG. 1 and FIG. 2, for example, and various elements of these figuresare referenced in explaining the example method. Each block shown inFIG. 6 represents one or more processes, methods, or subroutines,carried out in the example method. Furthermore, the order of blocks isillustrative only and may change. Additional blocks may be added or lessblocks may be utilized without departing from the present disclosure.

At block 61, the decoder module 222 determines a block unit from animage frame according to video data.

In at least one implementation, the video data may be a bitstream. Thedestination device 12 may receive the bitstream from an encoder, such asthe source device 11, via the second interface 123 of the destinationdevice 12. The second interface 123 provides the bitstream to thedecoder module 222. The decoder module 222 determines the image framebased on the bitstream, and divides the image frame to determine theblock unit according to a plurality of partition indications in thebitstream. For example, the decoder module 222 may divide the imageframes to generate a plurality of coding tree units, and further divideone of the coding tree units to determine the block unit according tothe partition indications based on any video coding standard.

In at least one implementation, the entropy decoding unit 2221 maydecode the bitstream to determine a plurality of prediction indicationsfor the block unit, and then the decoder module 222 may furtherreconstruct the block unit based on the prediction indications. In atleast one implementation, the prediction indications may include aplurality of flags and a plurality of indices.

At block 62, the decoder module 222 determines a line index from thevide data.

In at least one implementation, there are a plurality of neighboringblocks neighboring to the block unit in the image frame. In at least oneimplementation, each of the neighboring blocks include a plurality ofneighboring samples. In at least one implementation, the neighboringsamples neighboring to the block unit in the neighboring blocks may beclassified into a plurality of reference lines. In the implementation,each of the reference lines includes a plurality of line samplesselected from the neighboring samples neighboring to the block unit.FIG. 4 is a schematic illustration of an example implementation of ablock unit 400 and reference lines having line samples, such as linesamples 4111, 4121, 4131, and 4141 in a first reference line 411, asecond reference line 412, a third reference line 413, and a fourthreference line 414, respectively.

In at least one implementation, the encoder module 112 may select one ofthe reference lines for predicting the block unit, and provide the lineindex indicating which is the selected reference line to the destinationdevice 12. In the implementation, the decoder module 222 may determinethe selected reference line based on the line index, and the decodermodule 222 may determine the line samples in the selected reference lineas a plurality of reference samples. Thus, the decoder module 222 mayreconstruct the block unit based on the reference samples. In at leastone implementation, the decoder module 222 may set a first one of thereference lines as the selected reference line based on the line index.In the implementation, the first reference line may be the firstreference line 411 adjacent to the block unit 400. In at least oneimplementation, the decoder module 222 may set a specific one of thereference lines different from the first reference line as the selectedreference line. In at least one implementation, the decoder module 222may select more than one of the reference lines as the selectedreference lines.

In at least one implementation, the decoder module 222 may select thefirst reference line 411 and determine the line samples in the firstreference line 411 as the reference samples, when the line index isequal to a first predefined value. In at least one implementation, thedecoder module 222 may select one of the other reference lines 412-414,when the line index is different from the first predefined value. In atleast one implementation, the line index may be a syntax elementintra_luma_ref_idx in versatile video coding (VVC) or VVC test model(VTM). In at least one implementation, the first predefined value may beequal to zero.

At block 63, the decoder module 222 determines, based on the line index,whether a mode flag is included in the video data. In at least oneimplementation, the procedure proceeds to block 64, when the decodermodule 222 determines that the mode flag is included in the video data.In at least one implementation, the procedure proceeds to block 65, whenthe decoder module 222 determines that the mode flag is not presented inthe video data.

In at least one implementation, the decoder module 222 may determine aprediction mode from a plurality of mode candidates to predict the blockunit. In at least one implementation, the mode candidates may include aplurality of non-angular modes and a plurality of angular modes. In theimplementation, the non-angular modes may include a Planar mode and a DCmode. In one implementation, the number of the angular modes may beequal to 65, when the decoder module 222 decodes the block unit in VVCor VTM. In another implementation, the number of the angular modes maybe equal to 33, when the decoder module 222 decodes the block unit inhigh efficiency video coding (HEVC). In at least one implementation, thedecoder module 222 may determine a plurality of most probable modes(MPMs) from the mode candidates based on the neighboring blocksneighboring to the block unit. In at least one implementation, aspecific one of the mode candidates may be set as one of the mostprobable modes for the block unit, when the decoder module 222reconstructs a specific one of the neighboring blocks according to thespecific mode candidate. In addition, the decoder module 222 may derivethe other of the most probable modes based on the specific modecandidate. In the implementation, the unselected mode candidates may beregarded as a plurality of remaining mode candidates, when the decodermodule 222 selects the most probable modes from the mode candidates.

In at least one implementation, the encoder module 112 may select theprediction mode from the most probable modes and the remaining modecandidates, when the encoder module 112 selects the first one of thereference lines to predict the block unit. In the implementation, theintra prediction unit 22221 needs the mode flag received from theencoder module 112 to determine whether the prediction mode is selectedfrom the MPMs, when the first one of the reference lines is selected topredict the block unit. Thus, the decoder module 222 may determine,based on the line index of the block unit, that the mode flag isincluded in the video data, since the line index of the block unit equalto the first predefined value indicates that the first one of thereference lines is selected to predict the block unit.

In at least one implementation, the encoder module 112 may select theintra prediction mode only from the most probable modes, when theencoder module 112 selects a specific one of the reference linesdifferent from the first reference line to predict the block unit. Inthe implementation, it is unnecessary for the intra prediction unit22221 to receive the mode flag indicating whether the prediction mode isselected from the MPMs, when the selected reference line is differentfrom the first one of the reference lines. Thus, the decoder module 222may determine, based on the line index of the block unit, that the modeflag is not presented in the video data, since the line index of theblock unit different from the first predefined value indicates that theselected reference line is different from the first one of the referencelines.

At block 64, the decoder module 222 determines whether a flag value ofthe mode flag is equal to a predefined value. In at least oneimplementation, the procedure proceeds to block 65, when the flag valueis equal to the predefined value. In at least one implementation, theprocedure proceeds to block 66, when the flag value is different fromthe predefined value.

In at least one implementation, the encoder module 112 may set the modeflag be equal to a second predefined value, when the encoder module 112selects the prediction mode from the MPMs to predict the block unit. Inat least one implementation, the encoder module 112 may set the modeflag be different from the second predefined value, when the encodermodule 112 selects the intra prediction mode from the remaining modecandidates to predict the block unit. In at least one implementation,the mode flag may be a syntax element pre_intra_luma_pred_flag in HEVC.In at least one implementation, the mpm flag may be a syntax elementintra_luma_mpm_flag in VVC or VTM. In at least one implementation, thesecond predefined value may be equal to one.

In at least one implementation, the prediction mode may be selected fromthe most probable modes and the remaining mode candidates, when thedecoder module 222 determines that the first reference line is selectedto reconstruct the block unit before parsing the mode flag. Thus, thedecoder module 222 may determine whether the mode flag is equal to thesecond predefined value for determining the prediction mode. In oneimplementation, the decoder module 222 may determine that the predictionmode is selected from the remaining mode candidates, when the decodermodule 222 determines that the mode flag is different from the secondpredefined value. In another implementation, the decoder module 222 maydetermine that the intra prediction mode is selected from the MPMs, whenthe decoder module 222 determines that the mode flag is equal to thesecond predefined value.

At block 65, the decoder module 222 determines a first mode index fromthe video data for determining the prediction mode.

In at least one implementation, the decoder module 222 may determine theprediction mode of the block unit is selected from the MPMs, when theline index is different from the first predefined value or the mode flagis equal to the second predefined value. In the implementation, theintra prediction unit 22221 may determine that the prediction mode maybe selected based on the first mode index from the MPMs. In at least oneimplementation, the first mode index may be an mpm index for selectingthe prediction mode from the MPMs. In at least one implementation, thempm index may be a syntax element mpm_idx in HEVC. In at least oneimplementation, the mpm index may be a syntax element intra_luma_mpm_idxin VVC or VTM.

At block 66, the decoder module 222 determines a second mode indexdifferent from the first mode index from the video data for determiningthe prediction mode.

In at least one implementation, the decoder module 222 may determine theprediction mode of the block unit is selected from the remaining modecandidates, when the mode flag is different from the second predefinedvalue. In the implementation, the decoder module 222 may determine thatthe prediction mode may be selected based on the second mode index fromthe remaining mode candidates. In at least one implementation, thesecond mode index may be a non-mpm index for selecting the predictionmode from the remaining mode candidates. In at least one implementation,the non-mpm index may be a syntax element rem_intra_luma_pred_mode inHEVC. In at least one implementation, the non-mpm index may be a syntaxelement intra_luma_mpm remainder in VVC or VTM.

At block 67, the decoder module 222 reconstructs the block unit based onthe line index and one of the first mode index and the second modeindex.

In at least one implementation, the intra prediction unit 22221 maydetermine the selected reference line based on the line index, and theintra prediction unit 22221 may determine the line samples in theselected reference line as the reference samples. Thus, the decodermodule 222 may reconstruct the block unit based on the referencesamples.

In at least implementation, the non-angular modes may be predefined toadd into the MPMs, when the encoder module 112 predicts the block unit.Thus, the encoder module 112 may add the Planar mode and the DC modeinto the MPMs. In at least one implementation, the intra prediction unit22221 also adds the non-angular modes into the MPMs to generate a mostprobable list. In other words, the most probable list may include thenon-angular mods and more than one of the angular modes selected basedon the predicted results of the neighboring blocks.

In at least one implementation, the encoder module 112 may adjust themost probable list, when the encoder module 112 determines the selectedreference line different from the first reference line for predictingthe block unit. In one implementation, the non-angular modes in the mostprobable list may be excluded to generate a sub list, when the encodermodule 112 determine that the selected reference line is different fromthe first reference line. In the implementation, the intra predictionunit 22221 may exclude the non-angular modes in the most probable listto generate the sub list, when the intra prediction unit 22221determines that the selected reference line determined based on the lineindex for reconstructing the block unit is different from the firstreference line. In other words, the prediction mode may be selected onlyfrom the MPMs included in the sub list based on the first mode index,when the intra prediction unit 22221 determines the selected referenceline for reconstructing the block unit is different from the firstreference line.

In at least one implementation, the encoder module 112 may remain themost probable list, when the encoder module 112 determines the selectedreference line for predicting the block unit is different from the firstreference line. Thus, the encoder module 112 may determine that thenon-angular modes in the most probable list may be used to predict theblock unit, when the encoder module 112 determines that the selectedreference line is different from the first reference line. In theimplementation, the intra prediction unit 22221 also remain the mostprobable list, when the intra prediction unit 22221 determines that theselected reference line determined based on the line index forreconstructing the block unit is different from the first referenceline. In other words, the non-angular modes may be selected toreconstruct the block unit, when the intra prediction unit 22221determines the selected reference line different from the firstreference line to reconstruct the block unit.

In at least one implementation, the prediction mode may be selected fromone of the MPMs and the remaining mode candidates, when the selectedreference line is the first reference line. In at least oneimplementation, the prediction mode may be selected from one of theMPMs, when the selected reference line is different from the firstreference line. Thus, the selected reference line is the first referenceline, when the prediction mode is selected based on the second modeindex from the remaining mode candidates. In at least oneimplementation, the non-angular modes are excluded from the remainingmode candidates, since the non-angular modes are predefined to add intothe MPMss. Thus, the selected mode candidate is different from thenon-angular modes, when the intra prediction unit 22221 determines theprediction mode of the block unit based on the second mode index. In theimplementation, the prediction mode is one of the angular modes, whenthe intra prediction unit 22221 determines the prediction mode of theblock unit based on the second mode index.

In at least one implementation, the block unit may include a pluralityof block components. In the implementation, each of the block componentsmay be a pixel element. The intra prediction unit 22221 may select,based on the prediction mode, at least one of the line samples in theselected reference line for each of the block components. Then, theintra prediction unit 22221 may generate a plurality of predictedcomponents for the block components.

In at least one implementation, the first summer 2224 of the decodermodule 222 in the destination device 12 may add the predicted componentsinto a plurality of residual components determined from the bitstream toreconstruct the block unit. In addition, the decoder module 222 mayreconstruct all of the other block units in the image frame forreconstructing the image frame and the video.

FIG. 7 illustrates a flowchart in accordance with an exampleimplementation of a line quantity determination method. The examplemethod is provided by way of example only, as there are a variety ofways to carry out the method. The method described below may be carriedout using the configurations illustrated in FIG. 1 and FIG. 2, forexample, and various elements of these figures are referenced inexplaining the example method. Each block shown in FIG. 7 represents oneor more processes, methods, or subroutines, carried out in the examplemethod. Furthermore, the order of blocks is illustrative only and maychange. Additional blocks may be added or less blocks may be utilizedwithout departing from the present disclosure.

At block 71, the decoder module 222 determines a block unit having ablock size from an image frame according to video data.

In at least one implementation, the video data may be a bitstream. Thedestination device 12 may receive the bitstream from an encoder, such asthe source device 11, via the second interface 123 of the destinationdevice 12. The second interface 123 provides the bitstream to thedecoder module 222. The decoder module 222 determines the image framebased on the bitstream, and divides the image frame to determine theblock unit according to a plurality of partition indications in thebitstream. For example, the decoder module 222 may divide the imageframes to generate a plurality of coding tree units, and further divideone of the coding tree units to determine the block unit having theblock size according to the partition indications based on any videocoding standard. In at least one implementation, the block size mayinclude a block height and a block width.

In at least one implementation, the entropy decoding unit 2221 maydecode the bitstream to determine a plurality of prediction indicationsfor the block unit, and then the decoder module 222 may furtherreconstruct the block unit based on the prediction indications. In atleast one implementation, the prediction indications may include aplurality of flags and a plurality of indices.

At block 72, the intra prediction unit 22221 determines a number of oneor more reference lines based on the block size.

In at least one implementation, the prediction process unit 2222 of thedestination device 12 determines the block unit from the video data viathe entropy decoding unit 2221, and determines the one or more referencelines of the block unit. In at least one implementation, each of the oneor more reference lines has a plurality of line samples. With referenceto FIG. 4, the decoder module 222 may determine the block unit 400 andthe one or more reference lines each having the line samples, such asthe line samples 4111-4141 in a first reference line 411, a secondreference line 412, a third reference line 413, and a fourth referenceline 414, when the number of the one or more reference lines is equal tofour. In at least one implementation, the block unit 400 includes aplurality of block components, such a first block component 401. Theintra prediction unit 22221 may generate a predicted component for eachof the block components based on the one or more reference linesaccording to a prediction mode.

In at least one implementation, the intra prediction unit 22221 mayfirst determine the number of one or more reference lines, and thendetermine the prediction mode based on the number of one or morereference lines. For example, the intra prediction unit 22221 maydetermine that the prediction mode may be selected from a plurality ofmost probable modes (MPMs), when the number of one or more referencelines is greater than one. In addition, the intra prediction unit 22221may determine that the prediction mode may be selected from a pluralityof mode candidates, when the number of one or more reference lines isequal to one. In at least one implementation, the mode candidates may bea plurality of intra prediction modes. In at least one implementation,the MPMs may be selected from the mode candidates into a MPM list basedon a plurality of neighboring modes of a plurality of neighboring blocksneighboring to the block unit, when the neighboring modes are selectedfrom the mode candidates. In at least one implementation, the otherunselected mode candidates may be set as a plurality of non-MPMs in anon-MPM list.

In at least one implementation, the intra prediction unit 22221 maydetermine a size comparison based on the block size. In at least oneimplementation, the intra prediction unit 22221 may determine the sizecomparison based on the block size and a size threshold. In at least oneimplementation, the intra prediction unit 22221 may determine that thenumber of the one or more reference lines is equal to a predefinedquantity greater than one, when the size comparison satisfies apredefined condition. In at least one implementation, the intraprediction unit 22221 may determine that the number of the one or morereference lines is equal to one, when the size comparison does notsatisfy the predefined condition. In at least one implementation, thepredefined condition may include at least one of a plurality ofcomparison conditions. In at least one implementation, the intraprediction unit 22221 may determine whether the size comparisonsatisfies two of the comparison conditions, when the predefinedcondition includes the two of the comparison conditions.

In at least one implementation, the intra prediction unit 22221 maydetermine that the number of the one or more reference lines is equal toa first predefined quantity, when a size product W×H of the block widthW and the block height H is less than a first size threshold in a firstcomparison condition. In at least one implementation, the intraprediction unit 22221 may determine that the number of the one or morereference lines is equal to a second predefined quantity, when the sizeproduct W×H is greater than a second size threshold in a secondcomparison condition. In at least one implementation, the first sizethreshold is different from the second size threshold. In oneimplementation, the first size threshold is greater than the second sizethreshold. In at least one implementation, the intra prediction unit22221 may determine that the number of the one or more reference linesis equal to a third predefined quantity, when a size quotient W/H or H/Wof the block width W and the block height H is less than a third sizethreshold in a third comparison condition. In one implementation, theintra prediction unit 22221 may compare the size quotient W/H with thethird size threshold, when the block height H is longer than the blockwidth W. In another implementation, the intra prediction unit 22221 maycompare the size quotient H/W with the third size threshold, when theblock height H is longer than the block width W. In at least oneimplementation, the intra prediction unit 22221 may determine that thenumber of the one or more reference lines is equal to a fourthpredefined quantity, when the block width W is equal to the block heightH in a fourth comparison condition. In other words, the intra predictionunit 22221 may determine that the number of the one or more referencelines is equal to the fourth predefined quantity, when the size quotientW/H is equal to a fourth size threshold equal to one and different fromthe third size threshold in the fourth comparison condition. In at leastone implementation, each of the first predefined quantity, the secondpredefined quantity, the third predefined quantity, and the fourpredefined quantity may be a pre-assigned positive integer. For example,each of the first predefined quantity, the third predefined quantity,and the four predefined quantity may be equal to four, and the secondpredefined quantity may be equal to two. In at least one implementation,each of the first size threshold, the second size threshold, and thethird size threshold may be a pre-assigned positive integer. Forexample, the first size threshold may be equal to 4096, the second sizethreshold may be equal to 128, and the third size threshold may be equalto two. In at least one implementation, the intra prediction unit 22221may use at least one of the first size threshold, the second sizethreshold, the third size threshold, a comparison result between theblock width W and the block height H, and any other size comparisonconditions to determine the number of the one or more reference linesbased on at least one of the first predefined quantity, the secondpredefined quantity, the third predefined quantity, the four predefinedquantity, and any other predefined quantities.

In at least one implementation, more than one of the predefinedquantities may be selected to determine the number of the one or morereference lines simultaneously, when the intra prediction unit 22221determines the number of the one or more reference lines based on thepredefined condition including more than one of the comparisonconditions corresponding to the selected quantities. In theimplementation, the predefined condition may include more than one ofthe first comparison condition, the second comparison condition, thethird comparison condition, the fourth comparison condition, and anyother size comparison conditions.

In at least one implementation, the selected quantities may be equal toeach other. In at least one implementation, the intra prediction unit22221 may determine that the number of the one or more reference linesis equal to the selected quantities, when the size comparison satisfieseach of the comparison conditions in the predefined condition. Inaddition, the intra prediction unit 22221 may determine that the numberof the one or more reference lines is equal to one, when the sizecomparison does not satisfy one of the comparison conditions in thepredefined condition. For example, the intra prediction unit 22221 maydetermine that the number of the one or more reference lines is equal tothe first predefined quantity based on the comparison result that thesize product W×H is less than the first size threshold and the sizequotient W/H is less than the third size threshold, when the firstpredefined quantity is equal to the third predefined quantity. In atleast one implementation, the intra prediction unit 22221 may determinethat the number of the one or more reference lines is equal to theselected quantities, when the size comparison satisfies one of thecomparison conditions in the predefined condition. In addition, theintra prediction unit 22221 may determine that the number of the one ormore reference lines is equal to one, when the size comparison does notsatisfy each of the comparison conditions in the predefined condition.For example, the intra prediction unit 22221 may determine that thenumber of the one or more reference lines is equal to the firstpredefined quantity based on the comparison result that the size productW×H is greater than the first size threshold and the size quotient W/His less than the third size threshold, when the first predefinedquantity is equal to the third predefined quantity.

In at least one implementation, the selected quantities may be differentfrom each other. In at least implementation, the intra prediction unit22221 may determine which of the comparison conditions in the predefinedcondition the size comparison satisfies. In at least one implementation,the intra prediction unit 22221 may determine that the number of the oneor more reference lines is equal to one of the selected quantities, whenthe size comparison satisfies only one of the comparison conditions inthe predefined condition corresponding to the determined quantity. In atleast one implementation, the intra prediction unit 22221 may determinethat the number of the one or more reference lines based on more thanone of the selected quantities, when the size comparison satisfies morethan one of the comparison conditions corresponding to the determinedquantities. In at least one implementation, the intra prediction unit22221 may determine the number of the one or more reference lines isequal to the minimum of the determined quantities. In at least oneimplementation, the intra prediction unit 22221 may determine the numberof the one or more reference lines is equal to the maximum of thedetermined quantities. In addition, the intra prediction unit 22221 maydetermine that the number of the one or more reference lines is equal toone, when the size comparison does not satisfy each of the comparisonconditions in the predefined condition. For example, the intraprediction unit 22221 may determine that the number of the one or morereference lines is equal to the second predefined quantity based on thecomparison result that the size product W×H is greater than the secondsize threshold and the size quotient W/H is less than the third sizethreshold, when the second predefined quantity is less than the thirdpredefined quantity.

At block 73, the intra prediction unit 22221 selects one of the one ormore reference lines based on the number of the one or more referencelines.

In at least one implementation, the intra prediction unit 22221 maydecode a line index in the bitstream to select one of the one or morereference lines as a prediction line, when the number of the one or morereference lines is greater than one. In at least one implementation, theintra prediction unit 22221 may directly determine the one or morereference lines as the prediction line, when the number of the one ormore reference lines is equal to one. In the implementation, there maybe no line index for the block unit in the bitstream. In at least oneimplementation, the one or more reference lines may be predefined as thefirst reference line 411, when the number of the one or more referencelines is equal to one.

In at least one implementation, the intra prediction unit 22221 maydecode the line index in the bitstream to select one of the one or morereference lines, when the intra prediction unit 22221 determines thatthe size product W×H is less than the first size threshold. In at leastone implementation, there may be no line index for the block unit in thebitstream, when the size product W×H is greater than or equal to thefirst size threshold.

In at least one implementation, the intra prediction unit 22221 maydecode the line index in the bitstream to select one of the one or morereference lines, when the intra prediction unit 22221 determines thatthe size product W×H is greater than the second size threshold. In atleast one implementation, there may be no line index for the block unitin the bitstream, when the size product W×H is less than or equal to thesecond size threshold.

In at least one implementation, the intra prediction unit 22221 maydecode the line index in the bitstream to select one of the one or morereference lines, when the intra prediction unit 22221 determines thatthe size quotient W/H or H/W is less than the third size threshold. Inat least one implementation, there may be no line index for the blockunit in the bitstream, when the size quotient W/H or H/W is greater thanor equal to the third size threshold.

In at least one implementation, the intra prediction unit 22221 maydecode the line index in the bitstream to select one of the one or morereference lines, when the intra prediction unit 22221 determines thatthe block height H is equal to the block width W. In at least oneimplementation, there may be no line index for the block unit in thebitstream, when the block height H is different from the block width W.

In at least one implementation, the intra prediction unit 22221 maydecode the line index in the bitstream to select one of the one or morereference lines, when the intra prediction unit 22221 determines thatthe size comparison satisfies at least one of the comparison conditionsin the predefined condition. In at least one implementation, there maybe no line index for the block unit in the bitstream, when the sizecomparison does not satisfy each of the comparison conditions in thepredefined condition.

In at least one implementation, the intra prediction unit 22221 maydecode the line index in the bitstream to select one of the one or morereference lines, when the intra prediction unit 22221 determines thatthe size comparison satisfies each of the comparison conditions in thepredefined condition. In at least one implementation, there may be noline index for the block unit in the bitstream, when the size comparisondoes not satisfy one of the comparison conditions in the predefinedcondition.

At block 74, the intra prediction unit 22221 predicts the block unit ofthe image frame based on the selected one of the one or more referencelines.

In at least one implementation, the prediction mode may be selected fromthe mode candidates based on a mode flag and a mode index. In at leastone implementation, the mode flag indicates whether the prediction modeis selected from the MPM list. In at least one implementation, the modeindex is an MPM index indicating one of the MPMs, when the predictionmode is selected from the MPM list. In at least one implementation, themode index is an non-MPM index indicating one of the non-MPMs, when theprediction mode is include in the non-MPM list. In at least oneimplementation, the intra prediction unit 22221 determines theprediction mode based on the mode flag and the mode index, when theselected one of the one or more reference lines is identical to thefirst one of the one or more reference lines. In at least oneimplementation, the intra prediction unit 22221 determines theprediction mode based on the MPM index without parsing the mode flag,when the selected one of the one or more reference lines includes one ofthe one or more reference lines different from the first one of the oneor more reference lines. In at least one implementation, the first oneof the one or more reference lines is adjacent to the block unit.

In at least one implementation, the intra prediction unit 22221 mayselect, based on the prediction mode, at least one of the line samplesin the selected one of the one or more reference lines for each of theblock components. Then, the intra prediction unit 22221 may generate thepredicted components for the block components. In at least oneimplementation, the first summer 2224 of the decoder module 222 in thedestination device 12 may add the predicted components into a pluralityof residual components determined from the bitstream to reconstruct theblock unit. In addition, the decoder module 222 may reconstruct all ofthe other block units in the image frame for reconstructing the imageframe and the video.

FIG. 8 is a block diagram of an encoder module 812 representing anexample implementation of the encoder module 812 of the source device 11in the system of FIG. 1. In at least one implementation, the encodermodule 812 includes a prediction processor (e.g., a prediction processunit 8121), at least one summer (e.g., a first summer 8122 and a secondsummer 8125), a quantization/transform processor (e.g., atransform/quantization unit 8123), an inverse quantization/inversetransform processor (e.g., an inverse quantization/inverse transformunit 8124), a filter (e.g., a filtering unit 8126), a decoded picturebuffer (e.g., a decoded picture buffer 8127), and an entropy encoder(e.g., an entropy encoding unit 8128). In at least one implementation,the prediction process unit 8121 of the encoder module 812 furtherincludes a partition processor (e.g., a partition unit 81211), an intraprediction processor (e.g., an intra prediction unit 81212), and aninter prediction processor (e.g., an inter prediction unit 81213). In atleast one implementation, the encoder module 812 receives the sourcevideo, and encodes the source video to output a bitstream.

In at least one implementation, the encoder module 812 may receive asource video including a plurality of image frames, and then divide theimage frames according to a coding structure. In at least oneimplementation, each of the image frames may be divided into at leastone image block. The at least one image block may include a luminanceblock having a plurality of luminance samples, and at least onechrominance block having a plurality of chrominance samples. Theluminance block and the at least one chrominance block may be furtherdivided to generate macroblocks, coding tree units (CTUs), coding blocks(CBs), sub-divisions thereof, and/or another equivalent coding unit. Inat least one implementation, the encoder module 812 may performadditional sub-divisions of the source video. It should be noted thatthe present disclosure described herein are generally applicable tovideo coding, regardless of how the source video is partitioned prior toand/or during encoding.

In at least one implementation, during the encoding process, theprediction process unit 8121 receives a current image block of aspecific one of the image frames. The current image block may be one ofthe luminance block and the at least one of the chrominance block in thespecific image frame. The partition unit 81211 divides the current imageblock into multiple block units. The intra prediction unit 81212 mayperform intra-predictive coding of a current block unit relative to oneor more neighboring blocks in the same frame as the current block unitto provide spatial prediction. The inter prediction unit 81213 mayperform inter-predictive coding of the current block unit relative toone or more blocks in one or more reference image blocks to providetemporal prediction.

In at least one implementation, the prediction process unit 8121 mayselect one of the coding results generated by the intra prediction unit81212 and the inter prediction unit 81213 based on a mode selectionmethod, such as a cost function. In at least one implementation, themode selection method may be a rate-distortion optimization (RDO)process. The prediction process unit 8121 determines the selected codingresult, and provides a predicted block corresponding to the selectedcoding result to the first summer 8122 for generating a residual blockand to the second summer 8125 for reconstructing the encoded block unit.In at least one implementation, the prediction process unit 8121 mayfurther provide syntax elements, such as motion vectors, intra-modeindicators, partition information, and other syntax information, to theentropy encoding unit 8128.

In at least one implementation, the intra prediction unit 81212 mayintra-predict the current block unit. In at least one implementation,the intra prediction unit 81212 may determine an intra-prediction modedirecting toward reconstructed sample neighboring to the current blockunit to encode the current block unit. In at least one implementation,the intra prediction unit 81212 may encode the current block unit usingvarious intra-prediction modes, and the intra prediction unit 81212 orthe prediction process unit 8121 may select an appropriateintra-prediction mode from the tested modes. In at least oneimplementation, the intra prediction unit 81212 may encode the currentblock unit using a cross component prediction mode to predict one of thetwo chroma components of the current block unit based on the lumacomponents of the current block unit. In addition, the intra predictionunit 81212 may predict a first one of the two chroma components of thecurrent block unit based on the other of the two chroma components ofthe current block unit.

In at least one implementation, the inter prediction unit 81213 mayinter-predict the current block unit as an alternative to theintra-prediction performed by the intra prediction unit 81212, asdescribed above. The inter prediction unit 81213 may perform a motionestimation to estimate a motion of the current block unit for generatinga motion vector. The motion vector may indicate a displacement of thecurrent block unit within the current image block relative to areference block unit within a reference image block. In at least oneimplementation, the inter prediction unit 81213 receives at least onereference image block stored in the decoded picture buffer 8127 andestimates the motion based on the received reference image blocks togenerate the motion vector.

In at least one implementation, the first summer 8122 generates theresidual block by subtracting the prediction block determined by theprediction process unit 8121 from the original current block unit. Thefirst summer 8122 represents the component or components that performthis subtraction operation.

In at least one implementation, the transform/quantization unit 8123applies a transform to the residual block to generate a residualtransform coefficient, and then quantizes the residual transformcoefficients to further reduce bit rate. In at least one implementation,the transform may be DCT, DST, AMT, MDNSST, HyGT, signal dependenttransform, KLT, wavelet transform, integer transform, sub-band transformor a conceptually similar transform. In at least one implementation, thetransform may convert the residual information from a pixel value domainto a transform domain, such as a frequency domain. In at least oneimplementation, the degree of quantization may be modified by adjustinga quantization parameter. In at least one implementation, thetransform/quantization unit 8123 may perform a scan of the matrixincluding the quantized transform coefficients. Alternatively, theentropy encoding unit 8128 may perform the scan.

In at least one implementation, the entropy encoding unit 8128 mayreceive a plurality of syntax elements including quantization parameter,transform data, motion vectors, intra modes, partition information, andother syntax information, from the prediction process unit 8121, and thetransform/quantization unit 8123, and entropy encodes the syntaxelements into the bitstream. In at least one implementation, the entropyencoding unit 8128 entropy encodes the quantized transform coefficients.In at least one implementation, the entropy encoding unit 8128 mayperform CAVLC, CABAC, SBAC, PIPE coding or another entropy codingtechnique to generate an encoded bitstream. In at least oneimplementation, the encoded bitstream may be transmitted to anotherdevice (e.g., the destination device 12) or archived for latertransmission or retrieval.

In at least one implementation, the inverse quantization/inversetransform unit 8124 may apply inverse quantization and inversetransformation to reconstruct the residual block in the pixel domain forlater use as a reference block. In at least one implementation, thesecond summer 8125 adds the reconstructed residual block to theprediction block provided from the prediction process unit 8121 toproduce a reconstructed block for storage in the decoded picture buffer8127.

In at least one implementation, the filtering unit 8126 may include adeblocking filter, a SAO filter, a bilateral filter, and/or an ALF toremove blockiness artifacts from the reconstructed block. Additionalfilters (in loop or post loop) may also be used in addition to thedeblocking filter, the SAO filter, the bilateral filter and the ALF.Such filters are not shown for brevity, but if desired, may filter theoutput of the second summer 8125.

In at least one implementation, the decoded picture buffer 8127 may be areference picture memory that stores the reference block for use inencoding video by the encoder module 812, e.g., in intra- orinter-coding modes. The decoded picture buffer 8127 may be formed by anyof a variety of memory devices, such as DRAM, including SDRAM, MRAM,RRAM), or other types of memory devices. In at least one implementation,the decoded picture buffer 8127 may be on-chip with other components ofthe encoder module 812, or off-chip relative to those components.

FIG. 9 illustrates a flowchart in accordance with an exampleimplementation of a selection method for selecting a reference line anda prediction mode. The example method is provided by way of exampleonly, as there are a variety of ways to carry out the method. The methoddescribed below may be carried out using the configurations illustratedin FIG. 1 and FIG. 8, for example, and various elements of these figuresare referenced in explaining the example method. Each block shown inFIG. 9 represents one or more processes, methods, or subroutines,carried out in the example method. Furthermore, the order of blocks isillustrative only and may change. Additional blocks may be added or lessblocks may be utilized without departing from the present disclosure.

At block 91, the encoder module 812 determines a block unit from videodata, and determines a plurality of reference lines neighboring to theblock unit.

In at least one implementation, the video data may be a video. Thesource device 11 may receive the video by the source module 111. Theencoder module 812 determines the image frame from the video, anddivides the image frame to determine the block unit.

In at least one implementation, the prediction process unit 8121 of thesource device 11 determines the block unit from the video via thepartition unit 81211, and then the encoder module 812 provides aplurality of partition indications into a bitstream based on a partitionresult of the partition unit 81211.

In at least one implementation, the prediction process unit 8121 of thesource device 11 determines the neighboring blocks neighboring with theblock unit. In at least one implementation, the neighboring blocks maybe predicted prior to predicting the block unit, so the neighboringblocks may include a plurality of neighboring samples which may be usedto predicted the block unit. In at least one implementation, theneighboring samples neighboring to the block unit may be classified intothe reference lines based on a plurality of sample locations of theneighboring samples. FIG. 4 is a schematic illustration of an exampleimplementation of a block unit 400 and reference lines having linesamples, such as line samples 4111, 4121, 4131, and 4141 in a firstreference line 411, a second reference line 412, a third reference line413, and a fourth reference line 414, respectively. In at least oneimplementation, the block unit may be predicted prior to predicting someof the neighboring blocks, so the unpredicted neighboring blocks may notinclude the neighboring samples for the block unit.

At block 92, the prediction process unit 8121 selects a prediction modeand at least one of the reference lines for the block unit.

In at least one implementation, the intra prediction unit 81212 maypredict the block unit based on the reference lines according to aplurality of mode candidates. In at least one implementation, the interprediction unit 81213 may predict the block unit based on at least onereference frame in the video data according to at least one motionvector. In at least one implementation, the prediction process unit 8121may select the prediction mode from a plurality of prediction resultgenerated by the intra prediction unit 81212 and the inter predictionunit 81213. In at least one implementation, the prediction process unit8121 may also determine the selected at least one of the reference linesfor predicting the block unit, when the prediction mode is selected fromthe mode candidates.

At block 93, the encoder module 812 encodes into a bitstream a pluralityof prediction indications including a mode index and at least one of aline index and a mode flag for indicating the prediction mode and theselected at least one of the reference lines.

In at least one implementation, the line index may be equal to one of aplurality of first index values. In at least one implementation, each ofthe first index values corresponds to a reference set. In theimplementation, the number of the reference lines in each of thereference sets may be equal to or greater than one. In at least oneimplementation, a specific one of the first index values correspondingto the selected at least one of the reference lines may be selected forencoding into the bitstream, when the selected at least one of thereference lines is determined by the prediction process unit 8121.

In at least one implementation, the mode flag may indicate whether theprediction mode is included in a plurality of most probable modes (MPMs)selected from the mode candidates based on a plurality of neighboringmodes of the neighboring blocks. In at least one implementation, aspecific one of the neighboring modes may be added into the MPMs of theblock unit, when the specific neighboring mode is selected from the modecandidates. In at least one implementation, the mode candidates includea plurality of angular modes and a plurality of non-angular modes. In atleast one implementation the non-angular modes may be predefined to addinto the MPMs. In at least one implementation, the mode candidates whichare not selected into the MPMs may be set as a plurality of remainingmode candidates. In at least one implementation, the encoder module 812may determine a flag value of the mode flag based on a relationshipbetween the prediction mode and the MPMs. In at least oneimplementation, the flag value may be equal to one, when the predictionmode is included in the MPMs. In at least one implementation, the flagvalue may be equal to zero, when the prediction mode is not included inthe MPMs.

In at least one implementation, the mode index may be one of an MPMindex and a non-MPM index. In at least one implementation, the modeindex may be the MPM index indicating which one of the MPMs is theprediction mode, when the prediction mode is included in the MPMs. In atleast one implementation, the mode index may be the non-MPM indexindicating which one of the remaining mode candidates is the predictionmode, when the prediction mode is not included in the MPMs.

In at least one implementation, the encoder module 812 may first encodethe line index into the bitstream. In at least one implementation, theprediction mode may be selected from the MPMs and the remaining modecandidates, when the selected at least one of the reference lines is apredefined one of the reference lines. Thus, the mode flag may beincluded in the bitstream, when the line index indicates that theselected at least one of the reference lines is the predefined referenceline. In at least one implementation, the bitstream may include the modeflag and the mode index indicating the prediction mode and the lineindex indicating the predefined reference line, when the encoder module812 may first encode into the bitstream the line index indicating thatthe selected at least one of the reference lines is the predefinedreference line. In at least one implementation, the predefined referenceline may be the first reference line 411. In at least oneimplementation, the prediction mode is only selected from the MPMs, whenthe selected at least one of the reference lines includes one of thereference lines different from the predefined reference line. Thus,there may be no mode flag in the bitstream, when the line indexindicates that the selected at least one of the reference lines includesone of the reference lines different from the predefined reference line.In at least one implementation, the bitstream may include the line indexindicating the selected at least one of the reference lines and the MPMindex indicating one of the MPMs, when the encoder module 812 may firstencode into the bitstream the line index indicating that the selected atleast one of the reference lines includes one of the reference linesdifferent from the predefined reference line.

In at least one implementation, the encoder module 812 may first encodethe mode flag into the bitstream. In at least one implementation, theselected at least one of the reference lines is the predefined referenceline, when the prediction mode is selected from the remaining modecandidates. Thus, there may be no line index in the bitstream, when themode flag indicates that the prediction mode is included in theremaining mode candidates. In at least one implementation, the bitstreammay include the mode flag and the non-MPM index for determining on ofthe remaining mode candidates and the predefined reference line, whenthe encoder module 812 may first encode into the bitstream the mode flagindicating that the prediction mode is included in the remaining modecandidates. In at least one implementation, the selected at least one ofthe reference lines may be the predefined reference line or include oneof the reference lines different from the predefined reference line,when the prediction mode is selected from the MPMs. Thus, the bitstreamincludes the line index to indicate the selected at least one of thereference lines, when the mode flag indicates that the prediction modeis included in the MPMs. In at least one implementation, the bitstreammay include the line index indicating the selected at least one of thereference lines and the mode flag and the MPM index indicating one ofthe MPMs, when the encoder module 812 may first encode into thebitstream the mode flag indicating that the prediction mode is includedin the MPMs.

In at least one implementation, the encoder module 812 may perform theline quantity determination method as shown in FIG. 7. The method inFIG. 7 may be carried out using the configurations illustrated in FIG. 1and FIG. 8, for example, and various elements of these figures arereferenced in explaining the example method. Furthermore, the order ofblocks in FIG. 7 is illustrative only and may change. Additional blocksmay be added or less blocks may be utilized without departing from thepresent disclosure.

At block 71, the encoder module 812 determines a block size of a blockunit from an image frame according to video data.

In at least one implementation, the video data may be a video. Thesource device 11 may receive the video by the source module 111. Theencoder module 812 determines the image frame from the video, anddivides the image frame to determine the block unit.

In at least one implementation, the prediction process unit 8121 of thesource device 11 determines the block unit having the block size fromthe video via the partition unit 81211, and then the encoder module 812provides a plurality of partition indications into a bitstream based ona partition result of the partition unit 81211. In at least oneimplementation, the block size may include a block height H and a blockwidth W.

At block 72, the intra prediction unit 81212 determines a number of oneor more reference lines based on the block size.

In at least one implementation, the prediction process unit 2222 of thedestination device 12 determines the block unit from the video data viathe entropy decoding unit 2221, and determines the one or more referencelines neighboring to the block unit.

In at least one implementation, the prediction process unit 2222determines the number of the one or more reference lines based on a sizecomparison generated based on the block size and a size threshold. In atleast one implementation, the number of the one or more reference linesis equal to a predefined quantity greater than one, when the predictionprocess unit 2222 determines that the size comparison satisfies apredefine condition. In at least one implementation, the number of theone or more reference lines is equal to one, when the prediction processunit 2222 determines that the size comparison does not satisfy thepredefined condition. In at least one implementation, the predefinedcondition may include at least one of a first condition that the blocksize is less than a first threshold, a second condition that the blocksize is greater than a second threshold different from the firstthreshold, a third condition that a size ratio determined based on theblock width W and the block height H of the block size is less than athird threshold, a fourth condition that the size ratio is equal to afourth threshold different from the third threshold, and any other sizecomparison conditions.

At block 73, the intra prediction unit 81212 selects one of the one ormore reference lines based on the number of the one or more referencelines.

In at least one implementation, the intra prediction unit 81212 mayselect one of the one or more reference lines to predict the block unit,when the number of the one or more reference lines is greater than one.In at least one implementation, the intra prediction unit may directlyuse the one or more reference lines to predict the block unit, when thenumber of the one or more reference lines is equal to one.

At block 74, the intra prediction unit 81212 predicts the block unitbased on the selected one of the one or more reference lines.

In at least one implementation, the block unit may include a pluralityof block components. In the implementation, each of the block componentsmay be a pixel element. In at least one implementation, the intraprediction unit 81212 may determine, according to one of a plurality ofintra prediction modes, one of a plurality of predicted components basedon the selected one of the one or more reference lines for each of theblock components. In at least one implementation, the intra predictionunit 81212 may select another one of the one or more reference lines topredict the block unit according to the intra prediction modes.

In at least one implementation, the intra prediction unit 81212 maypredicts the block unit based on the one or more reference linesaccording to the intra prediction modes to generate a plurality ofpredicted results. In at least one implementation, the predictionprocess unit 8121 may select one of predicted results based on a modeselection method, such as a cost function. In at least oneimplementation, the mode selection method may be a rate-distortionoptimization (RDO) process. In the implementation, the predictionprocess unit 8121 sets one of the intra prediction modes and one of theone or more reference lines used to generate the selected coding resultas a prediction mode of the block units.

In at least one implementation, the encoder module 812 predicts theblock unit to generate a plurality of residual samples based on thepredicted components, and provide the bitstream including a plurality ofcoefficients corresponding to the residual samples.

From the above description, it is manifest that various techniques maybe used for implementing the concepts described in the presentapplication without departing from the scope of those concepts.Moreover, while the concepts have been described with specific referenceto certain implementations, a person of ordinary skill in the art wouldrecognize that changes can be made in form and detail without departingfrom the scope of those concepts. As such, the described implementationsare to be considered in all respects as illustrative and notrestrictive. It should also be understood that the present applicationis not limited to the particular implementations described above, butmany rearrangements, modifications, and substitutions are possiblewithout departing from the scope of the present disclosure.

What is claimed is:
 1. A method of decoding a bitstream by an electronicdevice, the method comprising: determining a block unit from an imageframe according to the bitstream; determining a line index of the blockunit in the bitstream; comparing the line index with a first predefinedvalue to determine whether a mode flag is included in the bitstream;determining a mode index in the bitstream for directly selecting aprediction mode of the block unit from a most probable mode (MPM) listof the block unit when the mode flag is not included in the bitstream;comparing the mode flag to a second predefined value when the mode flagis included in the bitstream to determine whether the prediction mode isselected from the MPM list based on the mode index; selecting one of aplurality of reference lines based on the line index; and reconstructingthe block unit based on the selected one of the plurality of referencelines and the prediction mode.
 2. The method according to claim 1,wherein the prediction mode of the block unit is selected from aplurality of mode candidates based on the mode flag, when the selectedone of the plurality of reference lines is identical to a first one ofthe plurality of reference lines adjacent to the block unit andindicated by the first predefined value.
 3. The method according toclaim 2, wherein: the plurality of mode candidates is categorized intothe MPM list and a non-MPM list; and the mode flag indicates in whichone of the MPM list and the non-MPM list the prediction mode isincluded.
 4. The method according to claim 2, wherein the predictionmode is selected based on the mode index from the MPM list withoutparsing the mode flag, when the selected one of the plurality ofreference lines is different from the first one of the plurality ofreference lines.
 5. An electronic device for decoding a bitstream, theelectronic device comprising: at least one processor; and a storagedevice coupled to the at least one processor and storing a plurality ofinstructions which, when executed by the at least one processor, causesthe at least one processor to: determine a block unit from an imageframe according to the bitstream; determine a line index of the blockunit in the bitstream; compare the line index with a first predefinedvalue to determine whether a mode flag is included in the bitstream;determine a mode index in the bitstream for directly selecting aprediction mode of the block unit from a most probable mode (MPM) listof the block unit when the mode flag is not included in the bitstream;compare the mode flag to a second predefined value when the mode flag isincluded in the bitstream to determine whether the prediction mode isselected from the MPM list based on the mode index; select one of aplurality of reference lines based on the line index; and reconstructthe block unit based on the selected one of the plurality of referencelines and the prediction mode.
 6. The electronic device according toclaim 5, wherein the prediction mode of the block unit is selected froma plurality of mode candidates based on the mode flag, when the selectedone of the plurality of reference lines is identical to a first one ofthe plurality of reference lines adjacent to the block unit andindicated by the first predefined value.
 7. The electronic deviceaccording to claim 6, wherein the prediction mode is selected from theMPM list including a plurality of most probable modes determined fromthe plurality of mode candidates, when the selected one of the pluralityof reference lines is different from the first one of the plurality ofreference lines.
 8. A method of decoding a bitstream by an electronicdevice, the method comprising: determining a block unit from an imageframe according to the bitstream; determining a line index in thebitstream for selecting a prediction line of the block unit from aplurality of reference lines; determining, based on the line index,whether a mode flag is included in the bitstream; directly determining amost probable mode (MPM) index from the bitstream for selecting aprediction mode of the block unit from a MPM list of the block unit whenthe mode flag is not included in the bitstream; comparing the mode flagwith a predefined value for selecting one of the MPM index and a non-MPMindex to determine the prediction mode when the mode flag is included inthe bitstream; and reconstructing the block unit based on the predictionline and the prediction mode.
 9. The method according to claim 8,wherein the mode flag is included in the bitstream for indicating theselected one of the MPM index and the non-MPM index, when the predictionline indicated by the line index is identical to a first one of theplurality of reference lines, and the first one of the plurality ofreference lines is adjacent to the block unit.
 10. The method accordingto claim 9, wherein the prediction mode is selected directly based onthe MPM index from the MPM list without parsing the mode flag, when theprediction line is different from the first one of the plurality ofreference lines.
 11. The method according to claim 10, wherein the modeflag is not included in the bitstream, when the prediction line isdifferent from the first one of the plurality of reference lines.